package com.tq.teaching_quality.controller;


import com.tq.teaching_quality.entity.SurveyAnswerText;
import com.tq.teaching_quality.service.SurveyAnswerTextService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 问卷答卷用户自编写内容 前端控制器
 * </p>
 *
 * @author YTH
 * @since 2020-06-29
 */
@RestController
@RequestMapping("/survey-answer-text")
public class SurveyAnswerTextController {

    @Autowired
    private SurveyAnswerTextService SurveyAnswerTextService;

    //增加一条记录
    @RequestMapping("/AddSurveyAnswerText")
    public boolean AddSurveyAnswerText(@PathVariable("SurveyAnswerText") SurveyAnswerText SurveyAnswerText){
        return SurveyAnswerTextService.save(SurveyAnswerText);
    }

    //删除一条记录
    @RequestMapping("/DeleteSurveyAnswerText")
    public boolean DeleteSurveyAnswerText(@PathVariable("SurveyAnswerTextId") Long SurveyAnswerTextId){
        return SurveyAnswerTextService.removeById(SurveyAnswerTextId);
    }

    //查询全部记录
    @RequestMapping("/SelectAllSurveyAnswerText")
    public List<SurveyAnswerText> SelectAllSurveyAnswerText(){
        return SurveyAnswerTextService.list();
    }

    //修改一条记录
    @RequestMapping("/UpdateSurveyAnswerText")
    public boolean UpdateSurveyAnswerText(@PathVariable("SurveyAnswerText") SurveyAnswerText SurveyAnswerText){
        return SurveyAnswerTextService.updateById(SurveyAnswerText);
    }

}

